<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/include_list_head.jsp" %>
<title>维护菜单</title>
</head>
<script type="text/javascript">
    $(document).ready(function () {
                $(".iconDiv li").click(function () {
                    $(".iconDiv li div").removeClass("choosed");
                    $(this).find("div").addClass("choosed");
                    var tpm = $(this).attr("s");
                    var url = "./portalLogo-updateLogo.action?"+(new Date()).getTime();
                    $.post(url,
                            { tpm: tpm},
                            function (data) {
                                window.location.reload();
                            }
            );
        });
    });

</script>
<style>
    .iconDiv {
        width: 90%;
        height: 500px;
        overflow: auto;
        top: 0;
        left: 100px;
        background-color: #ccc;
        padding: 10px 20px;
    }

    .iconDiv ul {
        margin: 0;
        padding: 0;
    }

    .iconDiv ul li {
        float: left;
        list-style: none;
        margin: 0 8px 8px 0;
        display: inline-block;
        padding: 0;
        width: 153px;
        height: 100px;
        position: relative;
        cursor: pointer;
    }
    .iconDiv ul li div.iconDivParent {
        height: 100px;
        width:153px;
    }

    .iconDiv ul li div.choosed {
        border: 3px solid red;
    }

    .iconDiv ul li div img {
        position: absolute;
        width: 153px;
        height: 100px;
        left:0px;
        margin-left:3px;
        filter:invert;
    }


    .iconDiv ul li div .iconTitle {
        position: absolute;
        color: #fff;
        font-family: 'Microsoft YaHei';
        text-decoration: none;
        width: 100%;
        text-align: center;
        font-size: 14px;
        top: 75px;
    }
    #updateLogoButton{
        margin-top: 10px;
        margin-left:20px;
    }
</style>
<body>
    <div id="updateLogoButton">
        <button onclick="openEntity()"><span class="icon_add">上传图片</span></button>
    </div>
    <div class="box1" panelWidth="99%">
        <fieldset>
            <legend>资源列表</legend>
            <div class="iconDiv">
                <ul>
                    <s:form theme="simple" name="ysform">
                        <s:iterator value="resultData" var="icon">
                            <li s="<s:property value="icon"/>">
                                <div class="iconDivParent <s:if test="'logo.jpg' == #icon || 'logo.png' == #icon || 'logo.gif' == #icon" >choosed</s:if>">
                                    <img src="${basePath}/upload/<s:property value="icon"/>" >
                                </div>
                            </li>
                        </s:iterator>
                     </s:form>
                </ul>
            </div>
        </fieldset>
    </div>

</body>
</html>
